﻿using B.S.Sell.ErrorCode;
using B.S.Sell.Read.API.Application.Command123.PurNameCommand;
using B.S.Sell.Read.API.Dtos;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Sell.Read.API.Controllers
{
    /// <summary>
    /// 销售管理控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GetSellManageController : ControllerBase
    {
        private readonly IMediator mediator;

        public GetSellManageController(IMediator mediator) 
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public Task<ApiResult<Apipage<SellDtos>>> GetPurchase([FromQuery]GetPurchaseCommand command)
        {
            return mediator.Send(command);
        }
    }
}
